from werkzeug.exceptions import HTTPException

from app.libs.error import APIException


class Success(APIException):
    code = 201
    msg = 'ok'
    error_code = 0


class VerifyFail(APIException):
    code = 201
    msg = 'ok'
    error_code = 404


class DeleteSuccess(Success):
    code = 202
    error_code = 1


class NotFoundUser(Success):
    code = 203
    error_code = 2


class ServerError(APIException):
    code = 500
    msg = 'sorry, we made a mistake (*￣︶￣)!'
    error_code = 999


class ClientTypeError(APIException):
    # 400 401 403 404
    # 500
    # 200 201 204
    # 301 302
    code = 400
    msg = 'client is invalid'
    error_code = 1006


class ParameterException(APIException):
    code = 400
    msg = 'invalid parameter'
    error_code = 1000


class NotFound(APIException):
    code = 404
    msg = '没有数据'
    error_code = 1000


class AuthFailed(APIException):
    code = 401
    error_code = 1005
    msg = '认证失败,用户名或密码错误'


class Forbidden(APIException):
    code = 403
    error_code = 1004
    msg = '没有权限'

class NoBaseInfo(APIException):
    code = 406
    error_code = 1004
    msg = '请完善个人信息'

class PaySuccess(APIException):
    code = 200
    msg = '打款成功'
    error_code = 0


class PayFail(APIException):
    code = 400
    msg = ''
    error_code = 1002
